home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat 1997 April
/
macformat-049.iso
/
mac
/
Shareware Plus
/
Developers
/
dropg++
/
usr
/
src
/
examples
/
stat.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1996-10-31
|
311 b
|
13 lines
|
[
TEXT/R*ch
]
#include <stdio.h>
#include <sys/stat.h>
main(int argc, char **argv)
{
char name[99];
struct stat statbuf;
strcpy(name, argv[argc-1]);
if (stat(name, &statbuf)) perror(name),exit(-2);
printf("File size = %d bytes\n", statbuf.st_size);
exit(0);
}